#include "SetID.h"

using namespace std;

void SetID::print_all(string file){
	for (auto p = file.begin(); p != file.end(); p++){
		if ((*p)=='.'){
			p = file.end();
			break;
		}
	}


	ofstream outfile;
	outfile.open(file + ".SetID", ios::out);
	
	for (auto it = setidvec.begin(); it != setidvec.end(); it++){
		for (auto it2 = (*it)->get_markervec().begin(); it2 != (*it)->get_markervec().end(); it2++){
			outfile << (*it)->get_setid() << '\t' << (*it2)->get_chr() << '\t' << (*it2)->get_markerid() << '\t' << (*it2)->get_pos() << endl;
		}
	}
	outfile.close();
}

void SetID::print_all(){
	for (auto it = setidvec.begin(); it != setidvec.end(); it++){
		for (auto it2 = (*it)->get_markervec().begin(); it2 != (*it)->get_markervec().end(); it2++){
			cout << (*it)->get_setid() << '\t' << (*it2)->get_chr() << '\t' << (*it2)->get_markerid() << '\t' << (*it2)->get_pos() << endl;
		}
	}
}